import {IconType} from "@icon-park/vue-next/es/all";

export interface UserModel {
    updated_at: string;
    name: string;
    created_at: string;
    email_verified_at: any;
    id: number;
    avatar?: string;
    email: string;
    phone?:string|number
    is_super_admin: string;
    is_freeze:'yes'|'no'
}

export interface LoginData {
    user: UserModel
    token: string;
}

export interface RegisterData {
    user: UserModel;
    token: string;
}

export interface ApiData<T> {
    code: number;
    message?: string;
    status: 'success' | 'error';
    data: T;
}

export interface MyCaptcha {
    img: string;
    sensitive: boolean;
    key: string;
}

export interface MyCat {
    updated_at: string;
    icon: IconType
    created_at: string;
    id: number;
    sort: number;
    title: string;
}

export interface PageData<T> {
    data: T[]
    links: { first: string; last: string; prev?: any; next?: any }
    meta: {
        current_page: number
        from: number
        last_page: number
        links: { url?: string; label: string; active: boolean }[]
        path: string
        per_page: number
        to: number
        total: number
    }
}

export interface MyTopic {
    updated_at: string;
    user_id: number;
    is_hot: string;
    cat: MyCat;
    cat_id: number;
    created_at: string;
    id: number;
    sort: number;
    title: string;
    user: UserModel;
    content: string;
    html: string
}

export interface MyConfig {
    QQ?: string;
    site_name?: string;
    copyright?: string;
    ICP?: string;
    tel?: string;
    wechat_pay?: string;
    aliyun_pay?: string;
}

// interface BaseComment{
//  id: number;
//  topic_id:number;
//  user_id:number;
//  reply_comment_id?:number;
//  reply_user_id?:number;
//  content:string;
//  created_at:string;
//  updated_at:string;
//  topic?:MyTopic;
//  user:UserModel;
//  html:string;
//  reply_user?:any;
//  comment?:any
// }

export interface MyComment {
    id: number | string;
    topic_id: number;
    user_id: number;
    reply_comment_id?: number;
    reply_user_id?: number;
    content: string;
    created_at: string;
    updated_at: string;
    topic?: MyTopic;
    user: UserModel;
    html: string;
    reply_user?: any;
    comment?: any
    reply_comments?: MyComment[];
    belong_to_comment?: MyComment;
}

export interface MyFavorite {
    is_favorite: boolean
}

export interface MyTab {
    label: string,
    routeName?: string,
    event?: () => void,
    switchShow?: boolean
}
export interface MySite {
	site_name: string;
	copyright: string;
	ICP: string;
	tel: string;
	wechat_pay: string;
	aliyun_pay: string;
}




